package dev.admin.controller;

import dev.admin.mapper.SysUserMapper;
import dev.admin.service.SysUserService;
import dev.common.base.BaseController;
import dev.common.entity.SysUser;
import dev.common.mapper.entity.Condition;
import dev.common.mapper.entity.Example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
public class CountryController extends BaseController{

    @Autowired
    public SysUserService userService;

    @RequestMapping("test")
    @ResponseBody
    public Object test() {
        Example example = new Example(SysUser.class);
        example.createCriteria().andEqualTo("loginName", "chenjy");
        SysUser user = new SysUser.Build().id(1).build();
//        throw new IllegalArgumentException("参数错误");
        List<SysUser> byExample = userService.findByExample(example);
        return byExample;
    }
}
